var t = require("../../../@babel/runtime/helpers/defineProperty");

require("../../../@babel/runtime/helpers/Objectvalues");

var a = getApp(), e = require("../../../mybehaviors/location/location");

Page({
    behaviors: [ e ],
    data: {
        shop_commission: !1,
        customer_open: !0,
        service_QRcode: "",
        service_mobile: "",
        show1: !1,
        msgText: 0,
        pass_safe: 0,
        showtips: !0,
        swlist: [],
        swlis: [],
        shenqShow: !1,
        is_hotel: !1,
        uploadUrl: "",
        o2o_status: 1,
        o2o_info: "",
        address: "",
        point: {
            lat: "",
            lng: ""
        },
        city: "",
        title: "",
        noIs: !0,
        bor: !0,
        showDel: !1,
        signature: "",
        applyModel: {
            password: "",
            realname: "",
            mobile: "",
            storeName: "",
            lng: "",
            lat: "",
            beginTime: "00:00",
            endTime: "00:00",
            categoryId: "",
            provinceId: "",
            cityId: "",
            districtId: "",
            streetId: "",
            address: "",
            storeImg: "",
            aptitudeImg: [],
            remark: "",
            starRated: "",
            otherImg: [],
            information_thumb: "",
            idCardImg: []
        },
        categoryName: "",
        strShow: !1,
        provinceData: [],
        cityData: [],
        districtData: [],
        pickerValue: [ 0, 0, 0 ],
        selectAddressData: [],
        districtVal: [],
        streetShow: !1,
        addressShow: !1,
        addressName: "",
        provice: "",
        beginTimeshow: !1,
        endTimeshow: !1,
        imageUrl: "",
        hotelTitleType: "",
        levelShow: !1,
        star_arr: [ {
            name: "二星及以下/经济型",
            value: 2
        }, {
            name: "三星/舒适",
            value: 3
        }, {
            name: "四星/高档",
            value: 4
        }, {
            name: "五星/豪华",
            value: 5
        }, {
            name: "六星",
            value: 6
        }, {
            name: "七星",
            value: 7
        }, {
            name: "八星",
            value: 8
        }, {
            name: "不限",
            value: 0
        } ],
        goods_id: "",
        status: !1,
        coverViewFlag: !1,
        apply_switch: !1
    },
    onLoad: function(t) {
        var a = this;
        try {
            wx.removeStorageSync("applyaddresspoint");
        } catch (t) {}
        this.initData(), "hotelApply" == t.name ? (this.setData({
            is_hotel: !0,
            uploadUrl: "upload.uploadPic"
        }), this.getCustomizeHotelHead()) : (wx.setNavigationBarTitle({
            title: "门店申请"
        }), this.setData({
            uploadUrl: "upload.uploadPic"
        })), this.checkrouter(), this._initAddressInfo(), this.isToGoos(), this.getData(), 
        this._getLocation(function(t, e) {
            a.setData({
                "applyModel.lng": e.lng,
                "applyModel.lat": e.lat,
                mapdata_address: t.address
            });
        }), this.getCategory(), this.setWatcher(this.data, this.watch);
    },
    isToGoos: function() {
        var t = this, e = a.getNetAddresss("plugin.store-cashier.frontend.store.enter.enable");
        a._getNetWork({
            url: e,
            success: function(a) {
                var e = a.data;
                1 == e.result && (t.data.status = e.data.status);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    checkrouter: function() {
        for (var t, a, e = wx.getStorageSync("yz_basic_info"), o = e.popularize_page.mini.vue_route, s = 0; s < o.length; s++) if ("storeApply" == o[s]) return console.log(e.popularize_page.mini.mini_url + "跳转的路径"), 
        void wx.showToast({
            title: "未开启推广权限",
            duration: 2e3,
            icon: "none",
            success: function() {
                setTimeout(function() {
                    wx.redirectTo({
                        url: e.popularize_page.mini.mini_url
                    });
                }, 1e3);
            }
        });
        this.setData({
            apply_switch: null !== (t = null === (a = e.plugin_setting.sub_platform) || void 0 === a ? void 0 : a.apply_switch) && void 0 !== t && t
        });
    },
    showdel: function(t) {
        console.log(t), this.setData({
            showDel: !0
        });
    },
    delIntu: function(t) {
        var a = this.data.showpaths;
        this.setData({
            showpaths: a
        });
    },
    delIntu_2: function(t) {
        var a = this.data.showpaths_two;
        this.setData({
            showpaths_two: a
        });
    },
    shenqShow: function() {
        this.setData({
            shenqShow: !0
        });
    },
    onClicksQ: function() {
        this.setData({
            shenqShow: !1
        });
    },
    callKf: function() {
        console.log("联系客服");
    },
    onReady: function() {},
    onShow: function() {
        try {
            var t = wx.getStorageSync("applyaddresspoint");
            t && (this.setData({
                "applyModel.lng": t.point.lng,
                "applyModel.lat": t.point.lat,
                mapdata_address: t.address
            }), console.log(this.data.applyModel));
        } catch (t) {
            console.log(t);
        }
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    callPhone: function() {
        wx.makePhoneCall({
            phoneNumber: this.data.service_mobile
        });
    },
    showPop: function() {
        this.data.customer_open && this.setData({
            show1: !0
        });
    },
    closePop: function() {
        this.setData({
            show1: !1
        });
    },
    initData: function() {
        this.setData({
            customer_open: !0,
            service_QRcode: "",
            service_mobile: "",
            show1: !1,
            pass_safe: 0,
            showtips: !0,
            msgText: 0,
            o2o_status: 1,
            "applyModel.username": "",
            "applyModel.password": "",
            "applyModel.realname": "",
            "applyModel.mobile": "",
            "applyModel.storeName": "",
            "applyModel.lng": "",
            "applyModel.lat": "",
            "applyModel.categoryId": "",
            "applyModel.provinceId": "",
            "applyModel.cityId": "",
            "applyModel.districtId": "",
            "applyModel.streetId": "",
            "applyModel.storeImg": "",
            "applyModel.aptitudeImg": [],
            "applyModel.remark": "",
            agreementChoose: !1
        });
    },
    toGeolocation: function() {
        wx.navigateTo({
            url: "/packageC/o2o/o2oLocation_loc/o2oLocation_loc?tag=storeApply"
        });
    },
    getData: function() {
        var t = this, e = this, o = "";
        this.data.is_hotel ? o += a.getNetAddresss("plugin.hotel.frontend.hotel.hotel.verify-apply-status") : o += a.getNetAddresss("plugin.store-cashier.frontend.store.store.verify-apply-status"), 
        a._getNetWork({
            url: o,
            data: {
                validate_page: 1
            },
            success: function(o) {
                var s = o.data;
                1 == s.result ? (e.setData({
                    shop_commission: 1 == s.data.shop_commission,
                    o2o_status: s.data.status,
                    o2o_info: s.data.agreement,
                    top_thumb: s.data.top_thumb ? s.data.top_thumb : "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/o2oapply.png",
                    pass_safe: s.data.safe,
                    customer_open: "1" == s.data.customer_open,
                    service_QRcode: s.data.service_QRcode,
                    service_mobile: s.data.service_mobile,
                    is_business_license: s.data.is_business_license
                }), t.data.is_hotel || t.setData({
                    signature: s.data.signature
                }), -1 == s.data.status && Object.values(s.data.last_info.length > 0) && e.setData({
                    "applyModel.username": s.data.last_info.username,
                    "applyModel.realname": s.data.last_info.realname,
                    "applyModel.mobile": s.data.last_info.mobile,
                    "applyModel.storeName": s.data.last_info.information.store_name,
                    categoryName: s.data.last_info.information.store_category_text,
                    "applyModel.categoryId": s.data.last_info.information.category_id,
                    addressName: s.data.last_info.information.province + " " + s.data.last_info.information.city + " " + s.data.last_info.information.district,
                    "applyModel.provinceId": s.data.last_info.information.province_id,
                    "applyModel.cityId": s.data.last_info.information.city_id,
                    "applyModel.districtId": s.data.last_info.information.district_id,
                    "applyModel.address": s.data.last_info.information.address,
                    "applyModel.beginTime": s.data.last_info.information.business_hours_start,
                    "applyModel.endTime": s.data.last_info.information.business_hours_end,
                    imageUrl: s.data.last_info.information.thumb,
                    "applyModel.storeImg": s.data.last_info.information.thumb,
                    fileList2: s.data.last_info.information.banner_thumb,
                    "applyModel.bannerImg": s.data.last_info.information.banner_thumb,
                    "applyModel.storeIntroduce": s.data.last_info.information.store_introduce,
                    showpaths: s.data.last_info.information.information_thumb,
                    swlist: s.data.last_info.information.information_thumb,
                    "applyModel.information_thumb": s.data.last_info.information.information_thumb,
                    fileList3: s.data.last_info.information.aptitude_imgs,
                    "applyModel.aptitudeImg": s.data.last_info.information.aptitude_imgs,
                    fileList5: s.data.last_info.information.id_card_imgs[0],
                    fileList4: s.data.last_info.information.id_card_imgs[1],
                    "applyModel.idCardImg": s.data.last_info.information.id_card_imgs,
                    showpaths_two: s.data.last_info.information.other_imgs,
                    swlis: s.data.last_info.information.other_imgs,
                    "applyModel.otherImg": s.data.last_info.information.id_card_imgs,
                    "applyModel.shop_commission": s.data.last_info.information.shop_commission,
                    "applyModel.remark": s.data.last_info.information.remark
                }), a._isTextEmpty(s.data.cservice) ? (console.log("空的"), e.setData({
                    cservice: !1
                })) : (console.log("不空的"), e.setData({
                    cservice: !0
                }))) : wx.showToast({
                    icon: "none",
                    title: s.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getCategory: function() {
        var t = this, e = "";
        this.data.is_hotel ? e += a.getNetAddresss("plugin.hotel.frontend.hotel.hotel.get-hotel-categorys") : e += a.getNetAddresss("plugin.store-cashier.frontend.store.store.get-store-categorys"), 
        a._getNetWork({
            url: e,
            success: function(a) {
                var e = a.data;
                1 == e.result ? t.setData({
                    categoryList: e.data.store_categorys,
                    agreement: e.data.agreement
                }) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    usernameinp: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.username": a
        });
    },
    passwordinp: function(t) {
        var a = t.detail;
        this.setData({
            "applyModel.password": a
        }), this.data.msgText = this.checkStrong(a), 3 == this.data.msgText ? this.setData({
            showtips: !1
        }) : this.setData({
            showtips: !0
        });
    },
    checkStrong: function(t) {
        var a = 0;
        return t.length < 1 ? a : (/\d/.test(t) && a++, /[a-z]/.test(t) && a++, /[A-Z]/.test(t) && a++, 
        1 == a ? 1 : 2 == a ? 2 : 3 == a ? t.length < 8 ? 2 : 3 : void 0);
    },
    realnameinp: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.realname": a
        });
    },
    mobileinp: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.mobile": a
        });
    },
    storeNameinp: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.storeName": a
        });
    },
    showCategory: function() {
        this.setData({
            categoryShow: !0
        });
    },
    onClickLeft: function() {
        this.setData({
            categoryShow: !1
        });
    },
    chooseCategory: function(t) {
        var a = t.currentTarget.dataset.item;
        this.setData({
            categoryName: a.name,
            "applyModel.categoryId": a.id,
            categoryShow: !1
        });
    },
    addressShowbtn: function() {
        this.setData({
            addressShow: !0
        });
    },
    showAddBtn: function(a) {
        var e = a.currentTarget.dataset.idex;
        this.setData(t({}, "diydata[" + e + "].showAdd", !0));
    },
    _closeDateLw: function() {
        this.setData({
            addressShow: !1
        });
    },
    _initAddressInfo: function() {
        var t = this;
        wx.getStorage({
            key: "provinceData",
            success: function(a) {
                console.log("地址信息准备就绪"), t._getProvinceData();
            },
            fail: function(e) {
                console.log("省fail"), a._getNetWork({
                    url: a.getNetAddresss("member.member-address.address"),
                    success: function(a) {
                        var e = a.data, o = e.data.province, s = e.data.city, i = e.data.district;
                        wx.setStorage({
                            key: "provinceData",
                            data: o
                        }), wx.setStorage({
                            key: "cityData",
                            data: s
                        }), wx.setStorage({
                            key: "districtData",
                            data: i
                        }), t._initAddressInfo();
                    },
                    fail: function(t) {},
                    state: !0
                });
            }
        });
    },
    _getProvinceData: function() {
        var t = this;
        wx.getStorage({
            key: "provinceData",
            success: function(a) {
                console.log("省读取成功", a.data), t.setData({
                    provinceData: a.data
                }), t.setData({
                    "selectAddressData[0].name": a.data[t.data.pickerValue[0]].areaname,
                    "selectAddressData[0].id": a.data[t.data.pickerValue[0]].id,
                    "selectAddressData[0].index": t.data.pickerValue[0]
                }), t._getCityData();
            }
        });
    },
    _getCityData: function() {
        var t = this.data.selectAddressData[0];
        console.log("城市", "_data", t);
        var a = this;
        wx.getStorage({
            key: "cityData",
            success: function(e) {
                console.log("城市读取成功", e);
                for (var o = [], s = 0; s < e.data.length; s++) e.data[s].parentid == t.id && o.push(e.data[s]);
                console.log("城市数据筛选", o), a.setData({
                    cityData: o
                }), a.setData({
                    "selectAddressData[1].name": o[a.data.pickerValue[1]].areaname,
                    "selectAddressData[1].id": o[a.data.pickerValue[1]].id,
                    "selectAddressData[1].index": a.data.pickerValue[1]
                }), a._getDistrictData();
            }
        });
    },
    _getDistrictData: function() {
        var t = this.data.selectAddressData[1];
        console.log("地区", "_data", t), console.log(t);
        var a = this;
        wx.getStorage({
            key: "districtData",
            success: function(e) {
                console.log("地区读取成功");
                for (var o = [], s = 0; s < e.data.length; s++) e.data[s].parentid == t.id && o.push(e.data[s]);
                console.log("地区数据筛选", o), a.setData({
                    districtData: o
                }), console.log("districtData", o), a.setData({
                    "selectAddressData[2].name": o[a.data.pickerValue[2]].areaname,
                    "selectAddressData[2].id": o[a.data.pickerValue[2]].id,
                    "selectAddressData[2].index": a.data.pickerValue[2]
                }), console.log("over", a.data.selectAddressData);
            }
        });
    },
    bindChange: function(t) {
        var a = t.detail.value;
        this.data.pickerValue[0] != a[0] && (a[1] = 0, a[2] = 0), this.data.pickerValue[1] != a[1] && (a[2] = 0), 
        this.setData({
            "pickerValue[0]": a[0],
            "pickerValue[1]": a[1],
            "pickerValue[2]": a[2]
        }), this._initAddressInfo();
    },
    resultAdd: function() {
        var t = this.data.selectAddressData, a = t[0].name + " " + t[1].name + " " + t[2].name;
        this.setData({
            addressName: a,
            provice: t[0].name,
            city: t[1].name,
            district: t[2].name
        }), this.setData({
            "applyModel.provinceId": t[0].id,
            "applyModel.cityId": t[1].id,
            "applyModel.districtId": t[2].id,
            addressShow: !1
        }), this.getStreet(t[2].id);
    },
    getStreet: function(t) {
        var e = this, o = "";
        o += a.getNetAddresss("member.memberAddress.street"), o += "&district_id=" + t, 
        a._getNetWork({
            url: o,
            success: function(t) {
                var o = t.data;
                1 == o.result && !a._isTextEmpty(o.data) && o.data.length > 0 ? e.setData({
                    districtVal: o.data,
                    strShow: !0
                }) : e.setData({
                    strShow: !1
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    streetShowbtn: function() {
        this.setData({
            streetShow: !0
        });
    },
    treetShowLeft: function() {
        this.setData({
            streetShow: !1
        });
    },
    streetConfirm: function(t) {
        var a = t.currentTarget.dataset.item;
        this.setData({
            street: a.areaname,
            "applyModel.streetId": a.id,
            streetShow: !1
        });
    },
    addressinp: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.address": a
        });
    },
    endTimebtn: function() {
        this.setData({
            endTimeshow: !0
        });
    },
    endTimeClose: function() {
        this.setData({
            endTimeshow: !1
        });
    },
    beginTimemessage: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.beginTime": a
        });
    },
    endTimemessage: function(t) {
        var a = t.detail.value;
        this.setData({
            "applyModel.endTime": a
        });
    },
    onRead: function() {
        var t = this, e = a.getNetAddresss(this.data.uploadUrl);
        wx.chooseImage({
            count: 1,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                var o = a.tempFilePaths;
                console.log(o[0]);
                var s = o[0];
                wx.uploadFile({
                    url: e,
                    filePath: s,
                    name: "file",
                    success: function(a) {
                        var e = JSON.parse(a.data);
                        1 == e.result ? t.setData({
                            imageUrl: e.data.img_url,
                            "applyModel.storeImg": e.data.img_url
                        }) : wx.showToast({
                            icon: "none",
                            title: e.msg,
                            duration: 1500
                        });
                    }
                });
            }
        });
    },
    onRead_1: function() {
        var t = this, e = a.getNetAddresss(this.data.uploadUrl);
        wx.chooseImage({
            count: 1,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                var o = a.tempFilePaths;
                console.log(o[0]);
                var s = o[0];
                wx.uploadFile({
                    url: e,
                    filePath: s,
                    name: "file",
                    success: function(a) {
                        var e = JSON.parse(a.data);
                        1 == e.result ? (t.setData({
                            "applyModel.bannerImg": e.data.img_url,
                            fileList2: e.data.img_url
                        }), console.log(e)) : wx.showToast({
                            icon: "none",
                            title: e.msg,
                            duration: 1500
                        });
                    }
                });
            }
        });
    },
    onRead_6: function() {
        var t = this;
        wx.chooseImage({
            count: 9,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                t.unload({
                    tempFilePaths: a.tempFilePaths
                }, "2");
            }
        });
    },
    onRead_2: function() {
        var t = this;
        wx.chooseImage({
            count: 9,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                console.log(a.tempFilePaths), t.unload({
                    tempFilePaths: a.tempFilePaths
                }, "1");
            }
        });
    },
    unload: function(t, e) {
        console.log(e);
        var o = a.getNetAddresss(this.data.uploadUrl), s = this, i = t.i ? t.i : 0, n = t.success ? t.success : 0, l = t.fail ? t.fail : 0;
        wx.uploadFile({
            url: o,
            filePath: t.tempFilePaths[i],
            name: "file",
            formData: null,
            success: function(t) {
                var a = JSON.parse(t.data);
                console.log(a.data.img_url), "1" == e ? (s.data.swlist.push(a.data.img_url), s.setData({
                    showpaths: s.data.swlist,
                    "applyModel.information_thumb": s.data.swlist
                })) : 2 == e && (s.data.swlis.push(a.data.img_url), s.setData({
                    showpaths_two: s.data.swlis,
                    "applyModel.otherImg": s.data.swlis
                })), console.log(s.data.applyModel);
            },
            fail: function(t) {
                l++;
            },
            complete: function(a) {
                ++i == t.tempFilePaths.length ? (console.log("执行完毕"), console.log("成功：" + n + " 失败：" + l)) : (t.i = i, 
                t.success = n, t.fail = l, s.unload(t, e));
            }
        });
    },
    onRead_3: function() {
        var t = this, e = a.getNetAddresss(this.data.uploadUrl);
        wx.chooseImage({
            count: 1,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                var o = a.tempFilePaths;
                console.log(o[0]);
                var s = o[0];
                wx.uploadFile({
                    url: e,
                    filePath: s,
                    name: "file",
                    success: function(a) {
                        var e = JSON.parse(a.data);
                        1 == e.result ? t.setData({
                            fileList3: e.data.img_url,
                            "applyModel.aptitudeImg[0]": e.data.img_url
                        }) : wx.showToast({
                            icon: "none",
                            title: e.msg,
                            duration: 1500
                        });
                    }
                });
            }
        });
    },
    onRead_4: function() {
        var t = this, e = a.getNetAddresss(this.data.uploadUrl);
        wx.chooseImage({
            count: 1,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                var o = a.tempFilePaths;
                console.log(o[0]);
                var s = o[0];
                wx.uploadFile({
                    url: e,
                    filePath: s,
                    name: "file",
                    success: function(a) {
                        var e = JSON.parse(a.data);
                        1 == e.result ? (t.setData({
                            fileList4: s,
                            "applyModel.idCardImg[0]": e.data.img_url
                        }), console.log(t.data.applyModel.idCardImg)) : wx.showToast({
                            icon: "none",
                            title: e.msg,
                            duration: 1500
                        });
                    }
                });
            }
        });
    },
    onRead_5: function() {
        var t = this, e = a.getNetAddresss(this.data.uploadUrl);
        wx.chooseImage({
            count: 1,
            sizeType: [ "original", "compressed" ],
            sourceType: [ "album", "camera" ],
            success: function(a) {
                var o = a.tempFilePaths;
                console.log(o[0]);
                var s = o[0];
                wx.uploadFile({
                    url: e,
                    filePath: s,
                    name: "file",
                    success: function(a) {
                        var e = JSON.parse(a.data);
                        1 == e.result ? (t.setData({
                            fileList5: e.data.img_url,
                            "applyModel.idCardImg[1]": e.data.img_url
                        }), console.log(t.data.applyModel)) : wx.showToast({
                            icon: "none",
                            title: e.msg,
                            duration: 1500
                        });
                    }
                });
            }
        });
    },
    remarkinp: function(t) {
        var a = t.detail.value;
        console.log(a), this.setData({
            "applyModel.remark": a
        });
    },
    storeIn: function(t) {
        console.log(t.detail.value);
        var a = t.detail.value;
        this.setData({
            "applyModel.storeIntroduce": a
        });
    },
    Chooseinp: function(t) {
        var a = t.detail;
        this.setData({
            agreementChoose: a
        });
    },
    removeImg: function(t) {
        var a = t.currentTarget.dataset.index, e = this.data.applyModel.aptitudeImg, o = this.data.fileList2;
        e.splice(a, 1), o.splice(a, 1), this.setData({
            "applyModel.aptitudeImg": e,
            fileList2: o
        });
    },
    setApplyData: function() {
        if (console.log(this.data.applyModel), !a._isTextEmpty(this.data.applyModel.username) || this.data.apply_switch) if (!a._isTextEmpty(this.data.applyModel.password) || this.data.apply_switch) if (3 == this.data.msgText || 1 != this.data.pass_safe) if (a._isTextEmpty(this.data.applyModel.realname)) wx.showToast({
            icon: "none",
            title: "请填写真实姓名",
            duration: 1500
        }); else if (a._isTextEmpty(this.data.applyModel.mobile)) wx.showToast({
            icon: "none",
            title: "请填写手机号码",
            duration: 1500
        }); else if (a._isMoblie(this.data.applyModel.mobile)) wx.showToast({
            icon: "none",
            title: "请输入正确的手机号",
            duration: 1500
        }); else {
            if (a._isTextEmpty(this.data.applyModel.storeName)) return this.data.is_hotel ? void wx.showToast({
                icon: "none",
                title: "请填写酒店名称",
                duration: 1500
            }) : void wx.showToast({
                icon: "none",
                title: "请填写门店名称",
                duration: 1500
            });
            if (a._isTextEmpty(this.data.applyModel.storeImg)) return this.data.is_hotel ? void wx.showToast({
                icon: "none",
                title: "请上传酒店图片",
                duration: 1500
            }) : void wx.showToast({
                icon: "none",
                title: "请上传门店logo图片",
                duration: 1500
            });
            if (a._isTextEmpty(this.data.applyModel.categoryId)) return this.data.is_hotel ? void wx.showToast({
                icon: "none",
                title: "请选择酒店分类",
                duration: 1500
            }) : void wx.showToast({
                icon: "none",
                title: "请选择门店分类",
                duration: 1500
            });
            if (a._isTextEmpty(this.data.applyModel.provinceId) || a._isTextEmpty(this.data.applyModel.cityId) || a._isTextEmpty(this.data.applyModel.districtId)) wx.showToast({
                icon: "none",
                title: "请选择省市区",
                duration: 1500
            }); else if (a._isTextEmpty(this.data.applyModel.streetId) && this.setData(t({}, "applyModel.streetId", 0)), 
            a._isTextEmpty(this.data.applyModel.address)) wx.showToast({
                icon: "none",
                title: "请填写详细地址",
                duration: 1500
            }); else if (a._isTextEmpty(this.data.applyModel.lng) || a._isTextEmpty(this.data.applyModel.lat)) wx.showToast({
                icon: "none",
                title: "经纬度不能为空",
                duration: 1500
            }); else if (a._isTextEmpty(this.data.applyModel.beginTime) || a._isTextEmpty(this.data.applyModel.endTime)) wx.showToast({
                icon: "none",
                title: "营业开始时间活营业结束时间不能为空",
                duration: 1500
            }); else {
                if (this.data.is_hotel) {
                    if (a._isTextEmpty(this.data.applyModel.starRated)) return void wx.showToast({
                        icon: "none",
                        title: "请上选择星级",
                        duration: 1500
                    });
                } else {
                    if ("1" == this.data.is_business_license && a._isTextEmpty(this.data.applyModel.aptitudeImg)) return void wx.showToast({
                        icon: "none",
                        title: "请上传营业执照",
                        duration: 1500
                    });
                    if (a._isTextEmpty(this.data.applyModel.bannerImg)) return void wx.showToast({
                        icon: "none",
                        title: "请上传门店banner图片",
                        duration: 1500
                    });
                    if (a._isTextEmpty(this.data.applyModel.bannerImg)) return void wx.showToast({
                        icon: "none",
                        title: "请上传门店banner图片",
                        duration: 1500
                    });
                }
                if (this.data.agreementChoose) if (this.data.shop_commission && a._isTextEmpty(this.data.applyModel.shop_commission)) wx.showToast({
                    icon: "none",
                    title: "请输入平台提成",
                    duration: 1500
                }); else {
                    var e = this, o = {
                        apply: this.data.applyModel
                    }, s = "";
                    s = this.data.is_hotel ? a.getNetAddresss("plugin.hotel.frontend.hotel.hotel.apply") : a.getNetAddresss("plugin.store-cashier.frontend.store.store.apply"), 
                    a._postNetWork({
                        url: s,
                        showToastIn: !1,
                        data: o,
                        success: function(t) {
                            var a = t.data;
                            1 == a.result ? 1 == e.data.status ? (a.data.goods_id ? e.data.goods_id = a.data.goods_id : e.data.goods_id = a.data.goods_info.id, 
                            e.goOrder()) : wx.showModal({
                                showCancel: !1,
                                title: "",
                                content: a.msg,
                                success: function(t) {
                                    setTimeout(function() {
                                        e.goHome();
                                    }, 1500);
                                }
                            }) : wx.showToast({
                                icon: "none",
                                title: a.msg,
                                duration: 1500
                            });
                        },
                        fail: function(t) {}
                    });
                } else wx.showToast({
                    icon: "none",
                    title: "请同意申请协议",
                    duration: 1500
                });
            }
        } else wx.showToast({
            icon: "none",
            title: "请正确填写密码",
            duration: 1500
        }); else wx.showToast({
            icon: "none",
            title: "请填写密码",
            duration: 1500
        }); else wx.showToast({
            icon: "none",
            title: "请填写账号",
            duration: 1500
        });
    },
    shop_commissionInp: function(t) {
        console.log(t);
        var a = t.detail.value;
        this.setData({
            "applyModel.shop_commission": a
        });
    },
    goOrder: function() {
        var t = this.data.goods_id;
        wx.redirectTo({
            url: "/packageD/buy/myOrder_v2/myOrder_v2?tag=-2&goodsId=" + t + "&optionsId=&total=1"
        });
    },
    goHome: function() {
        wx.reLaunch({
            url: "/packageG/index/index"
        });
    },
    getCustomizeHotelHead: function() {
        var t = this, e = "";
        try {
            var o = wx.getStorageSync("customizeHotelHead");
            o && (e = o);
        } catch (t) {}
        if (a._isTextEmpty(e)) {
            var s = a.getNetAddresss("plugin.hotel.frontend.hotel.get-hotel-info.get-custom-name");
            a._getNetWork({
                url: s,
                success: function(a) {
                    var e = a.data;
                    if (1 == e.result) {
                        t.setData({
                            hotelTitleType: e.data.hotels
                        }), wx.setNavigationBarTitle({
                            title: "".concat(t.data.hotelTitleType, "申请")
                        });
                        try {
                            wx.setStorageSync("customizeHotelHead", JSON.stringify(e.data));
                        } catch (t) {
                            console.log(t);
                        }
                    }
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        } else this.setData({
            hotelTitleType: JSON.parse(e).hotels
        }), wx.setNavigationBarTitle({
            title: "".concat(t.data.hotelTitleType, "申请")
        });
    },
    levelShowbtn: function() {
        this.setData({
            levelShow: !0
        });
    },
    levelShowLeft: function() {
        this.setData({
            levelShow: !1
        });
    },
    chooseStarLevel: function(t) {
        var a = t.currentTarget.dataset.item;
        this.setData({
            "applyModel.starRated": a.value,
            levelShow: !1,
            levelName: a.name
        });
    },
    watch: {
        "shenqShow,categoryShow,addressShow,streetShow,levelShow,show1": function(t, a) {
            var e = this;
            console.log("刷新改变"), setTimeout(function() {
                e.setData({
                    coverViewFlag: t
                });
            }, 1e3);
        }
    },
    setWatcher: function(t, a) {
        var e = this;
        Object.keys(a).forEach(function(o) {
            for (var s = o.split(","), i = 0; i < s.length; i++) e.observe(t, s[i], a[o]);
        });
    },
    observe: function(t, a, e) {
        var o = this, s = t[a];
        Object.defineProperty(t, a, {
            configurable: !0,
            enumerable: !0,
            set: function(t) {
                s = t, e.call(o, t, s);
            },
            get: function() {
                return s;
            }
        });
    }
});